import apiClient from '@/utils/request'

const frontApi = {
  test() {
    return apiClient.get('/test')
  },
  getAllArticles(params = {}) {
    return apiClient.get('/articles', { params })
  },
  getArticle(id) {
    return apiClient.get(`/articles/${id}`)
  },
  getLatestCategories() {
    return apiClient.get(`/categories/latest`)
  },
  getLatestTags() {
    return apiClient.get(`/tags/latest`)
  },
  getMessages() {
    return apiClient.get('/messages');
  },
  createMessage(data) {
    return apiClient.post('/messages', data);
  },
  getPhotos() {
    return apiClient.get('/photos');
  },
}

export default frontApi
